package edu.nwpu.zya.coreops.modules.alert.service;

import com.baomidou.mybatisplus.extension.service.IService;
import edu.nwpu.zya.coreops.common.utils.PageUtils;
import edu.nwpu.zya.coreops.modules.alert.entity.RuleEntity;
import edu.nwpu.zya.coreops.modules.alert.vo.RuleVo;
import edu.nwpu.zya.coreops.modules.monitor.entity.MetricEntity;

import java.util.List;
import java.util.Map;

/**
 * 
 *
 * @author zhouyuang
 * @email 742025491@qq.com
 * @date 2022-04-19 20:16:07
 */
public interface RuleService extends IService<RuleEntity> {

    PageUtils queryPage(Map<String, Object> params);

    PageUtils queryRuleVoPage(Map<String, Object> params);

    RuleVo getRuleVoById(Long id);

    void saveRuleVo(RuleVo ruleVo);

    List<String> getRelatedInstancesByType(Integer type, Long userId);

    List<MetricEntity> getMetricsByInstanceAndType(String instanceId, Integer type);

    void updateByRuleVo(RuleVo ruleVo);

    void removeVoByRuleVos(List<RuleVo> ruleVos);

    void deleteAlertTask(List<Long> ruleIds);

    List<RuleEntity> getRulesByTypeAndInstance(Integer type, String instanceId);
}

